package com.eurabia.eggchat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.eurabia.eggchat.pojo.SysEggchatUserValidation;
import com.eurabia.eggchat.pojo.form.SysEggchatUserValidationForm;
import com.eurabia.eggchat.pojo.query.SysEggchatUserValidationQuery;
import com.eurabia.eggchat.dao.SysEggchatUserValidationDao;
import com.eurabia.eggchat.service.SysEggchatUserValidationService;

import javax.annotation.Resource;


/**
 * SysEggchatUserValidationService 
 */
@Service
public class SysEggchatUserValidationServiceImpl implements SysEggchatUserValidationService {
    @Resource
    private SysEggchatUserValidationDao sysEggchatUserValidationDao;
	
	/**
     * 查询 SysEggchatUserValidation
     */
    @Override
    public List<SysEggchatUserValidation> find(final SysEggchatUserValidationQuery query) {
        return sysEggchatUserValidationDao.find(query);
    }
    
    /**
     * 分页查询 SysEggchatUserValidation
     */
    @Override
    public Page<SysEggchatUserValidation> findByPage(final SysEggchatUserValidationQuery query) {
        PageHelper.startPage(query.getPage().intValue(), query.getLimit().intValue());
        return (Page<SysEggchatUserValidation>) sysEggchatUserValidationDao.find(query);
    }

    /**
     * 通过id得到一个 SysEggchatUserValidation
     */
    @Override
    public SysEggchatUserValidation get(final String id) {
        return sysEggchatUserValidationDao.get(id);
    }
    
    /**
     * 新增 SysEggchatUserValidation
     */
    @Override
    public void add(final SysEggchatUserValidationForm form) {
        sysEggchatUserValidationDao.add(form);
    }

    /**
     * 修改 SysEggchatUserValidation
     */
    @Override
    public int update(final SysEggchatUserValidationForm form) {
        return sysEggchatUserValidationDao.update(form);
    }
    
    /**
     * 删除一个 SysEggchatUserValidation
     */
    @Override
    public int delete(final String id) {
        return sysEggchatUserValidationDao.delete(id);
    }
	
	/**
     * 修改是否可用
     */
    @Override
    public int changeEnabled(final String id, final Integer enabled) {
        return sysEggchatUserValidationDao.changeEnabled(id, enabled);
    }
}